class Base{
    public int a = 2;
    public int b = 3;

    public void method(){
        System.out.println(a);
        System.out.println(b);
    }
    public void methodA(){
        System.out.println("Base中的methodA()");
    }

}
class Derived extends Base{
    public int a = 10;
    public int c = 29;

    public void method(){
        super.method();
        System.out.println(a);
        System.out.println(b);
        System.out.println(c);
        // 访问父类的成员变量时，需要借助super关键字
        // super是获取到子类对象中从基类继承下来的部分
      super.a = 200;
      super.b = 201;
    }
    public void methodA(int a) {
        System.out.println("Derived中的method(int)方法");
    }

}


public class Test2 {
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.method();
    }
}
